package oop.day02.Exercise;


public class Person
{
    String name;
    int age;
    String address;
    Person(){};
    Person(String name,int age,String address)
    {
        this.name = name;
        this.age = age;
        this.address = address;
    }

    void eat()
    {
        System.out.println("there is a person eating");
    }

    void sleep()
    {
        System.out.println(" there is a person sleeping");
    }

    void sayHi()
    {
        System.out.println("people say hi");
    }

}
class Student extends Person
{
    String className;
    int stuNo;
    Student(String name,int age,String address,String className,int stuNo)
    {
        super(name,age,address);
        this.className = className;
        this.stuNo = stuNo;
    }
    void study()
    {
        System.out.println("there is a student learning");
    }
    void sayHi()
    {
        System.out.println("student sayHi");
    }


}
class Teacher extends Person
{
    double salary;
    Teacher(String name,int age,String address,double salary)
    {
        super(name,age,address);
        this.salary = salary;
    }
    void teach()
    {
        System.out.println("there is a teacher teaching");
    }
    void sayHi()
    {
        System.out.println("there is a teacher sayHi");
    }
}
class Doctor extends Person
{
    String title;
    Doctor(String name,int age,String address,String title)
    {
        super(name,age,address);
        this.title = title;
    }
    void cut()
    {
        System.out.println(" there is a doctor cutting");
    }
}